package com.t168.appinfo.controller.reception;

import java.util.List;

import javax.annotation.Resource;

import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.ResponseBody;

import sun.util.logging.resources.logging;

import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONArray;
import com.sun.istack.internal.logging.Logger;
import com.t168.appinfo.entity.Dictionary;
import com.t168.appinfo.service.reception.Dictionary.DictionaryService;
import com.t168.appinfo.service.reception.Dictionary.impl.DictionaryServiceImpl;

@Controller
@RequestMapping("/dictionary")
public class DictionaryController {
	
	private Logger log = Logger.getLogger(DictionaryController.class);
	
	@Resource(name ="dictionaryService")
	private DictionaryService dictionaryService;

	public DictionaryService getDictionaryService() {
		return dictionaryService;
	}
	public void setDictionaryService(DictionaryService dictionaryService) {
		this.dictionaryService = dictionaryService;
	}
	@RequestMapping(value = "/getFlatFrom",method = RequestMethod.GET,produces = {"application/json;charset=UTF-8"})
	@ResponseBody
	public Object getFlatFrom() {
		List<Dictionary> dictionarys = dictionaryService.getFlatFrom();
		return JSON.toJSONString(dictionarys);
	}
	
	
	@RequestMapping(value = "/getStatus",method = RequestMethod.GET,produces = {"application/json;charset=UTF-8"})
	@ResponseBody
	public Object getStatus() {
		List<Dictionary> dictionarys = dictionaryService.getStatus();
		return JSON.toJSONString(dictionarys);
	}
	
}
